package com.fm.openinstall.a;

import com.fm.openinstall.f.*;
import android.os.*;
import com.fm.openinstall.c.*;
import java.util.concurrent.*;

public abstract class s implements Runnable
{
    private c a;
    private Handler b;
    private ExecutorService c;
    private q d;
    private long e;
    private String f;

    s(final ExecutorService c, final q d, final long e) {
        this.a = com.fm.openinstall.f.c.a(s.class);
        this.b = new Handler(Looper.getMainLooper());
        this.f = "OpenInstallRunnable";
        this.c = c;
        this.d = d;
        this.e = e;
    }

    public abstract b a(final long p0);

    public void a(final String f) {
        this.f = f;
    }

    @Override
    public void run() {
        final Future<b> submit = this.c.submit((Callable<b>)new t(this));
        b b;
        try {
            b = submit.get(this.e, TimeUnit.MILLISECONDS);
        }
        catch (Exception ex) {
            b = new b(com.fm.openinstall.c.c.c, -2);
            final StringBuilder sb = new StringBuilder();
            sb.append("request error : ");
            sb.append(ex.getMessage());
            b.b(sb.toString());
        }
        catch (TimeoutException ex2) {
            submit.cancel(true);
            b = new b(com.fm.openinstall.c.c.c, -4);
            final StringBuilder sb2 = new StringBuilder();
            sb2.append("request timeout : ");
            sb2.append(ex2.getMessage());
            b.b(sb2.toString());
        }
        this.b.post((Runnable)new u(this, b));
    }
}
